﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoVanHocTapData.Interface;
using CoVanHocTapData.Entities;

namespace CoVanHocTapData.Concretes
{
    public class QuyDinhMonHocDacBietRepository:IQuyDinhMonHocDacBietRepository
    {
        #region property
        DangKyPhuEntities entities;
        #endregion

        #region constructor
        public QuyDinhMonHocDacBietRepository()
        {
            entities = new DangKyPhuEntities();
        }
        #endregion

        #region IQuyDinhMonHocDacBietRepository Members

        public Entities.QuyDinhMonHocDacBiet LayQuyDinhTheoNienKhoa(int nienKhoaID)
        {
            return (from m in entities.QuyDinhMonHocDacBiets
                        where m.NienKhoaID.Value<=nienKhoaID
                        select m).ToList().LastOrDefault();
        }

        #endregion
    }
}
